#ifndef _PID_H_
#define _PID_H_

#include <stdint.h>

typedef struct 
{
    float SumError;  //误差累积

    float Kp;      //比例系数
    float Ki;      //积分系数
    float Kd;      //微分系数

    float LastError;  //上一次误差
    float LLastError; //上上次误差
}PID;

extern PID L_SpeedPID;
extern PID R_SpeedPID;

void PID_Date_Init(void);
void PID_Init(PID *sptr);
int16_t Loca_Contral(PID*sptr,int16_t Setpoint,int16_t Turepoint);

#endif

